package com.cd2cd.code_template.curd.service;

import com.cd2cd.code_template.vo.BaseRes;
import com.cd2cd.code_template.vo.PageData;

import java.util.Map;

public interface CURDService {

    /**
     * 获取数据库列表
     * @param entity
     * @param params
     * @return
     */
    <T> BaseRes<PageData<T>> entityPage(String entity, Map<String, Object> params) throws Exception;

    /**
     * 获取数据库表详情内容
     * @param entity
     * @param params
     * @return
     */
    <T> BaseRes<T> entityInfo(String entity, Map<String, Object> params) throws Exception;

    /**
     * 更新表字段
     * @param entity
     * @param params
     * @return
     */
    <T> BaseRes<T> entityUpdate(String entity, Map<String, Object> params) throws Exception;

    /**
     * 添加表字段
     * @param entity
     * @param params
     * @return
     */
    <T> BaseRes<T> entityAdd(String entity, Map<String, Object> params) throws Exception;

    /**
     * 册除表字段
     * @param entity
     * @param params
     * @return
     */
    <T> BaseRes<T> entityDel(String entity, Map<String, Object> params) throws Exception;
}
